In C/C++ these
logical connectives employ a technique known as lazy evaluation. They
evaluate their left hand operand, and then only evaluate the right hand one
if this is required. Clearly false && anything is always false, true
|| anything is always true. In such cases the second test is not evaluated. |
|
Not operates on
a single logical value, its effect is to reverse its state. It can be used as
follows. |
|